package com.qd.panda.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("panda_product_order")
public class ProductOrder extends Model<ProductOrder> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "order_id", type = IdType.ASSIGN_ID)
    private String orderId;
    /**
     * 订单金额
     */
    @TableField("order_amount")
    private BigDecimal orderAmount;
    /**
     * 实际支付金额
     */
    @TableField("pay_amount")
    private BigDecimal payAmount;
    /**
     * 优惠金额:这一单优惠了多少钱
     */
    @TableField("discount_amount")
    private BigDecimal discountAmount;
    /**
     * 支付状态:0未支付1支付成功2支付失败3已支付4取消支付
     */
    @TableField("pay_status")
    private Integer payStatus;
    /**
     * 业务ID:对应订单表中的第三方订单号
     */
    @TableField("bid")
    private String bid;
    /**
     * 添加时间
     */
    @TableField("add_time")
    private LocalDateTime addTime;
    /**
     * 用户ID
     */
    @TableField("user_id")
    private String userId;
    /**
     * 商品编号
     */
    @TableField("product_code")
    private String productCode;
    /**
     * 收货地址
     */
    @TableField("address_id")
    private String addressId;
    /**
     * 厂家
     */
    @TableField("factory")
    private String factory;

    public void freeData() {
        this.orderId = null;
        this.orderAmount = null;
        this.payAmount = null;
        this.discountAmount = null;
        this.payStatus = null;
        this.bid = null;
        this.addTime = null;
        this.userId = null;
        this.productCode = null;
        this.addressId = null;
        this.factory = null;
    }

}
